package com.test.dozer;

import com.tmpt.utils.FenAndYuan;
import org.dozer.CustomConverter;

/**
 * Created by wxy on 2017/9/13.
 */
public class FenAndYuanConverter implements CustomConverter{

    @Override
    public Object convert(Object dest, Object source, Class<?> destClass, Class<?> sourceClass) {
        //.out.println("-----------");
        //.out.println("S:"+sourceClass);
        //.out.println("D:"+destClass);
        if(source==null)return null;
        if(source instanceof Long){
            String yuan = FenAndYuan.fen2yuanStr(source);
            return yuan;
        }
        if(source instanceof String){
            return FenAndYuan.yuan2fenLng(String.valueOf(source));
        }
        return null;
    }


}
